


libname PSDO_RFS "The location of the data folder\PSDO_RFS";



/* Use Proc ttest to test the difference between two sample means */

%MACRO Difference(Dataset=,First_var=,Second_var=,Report_Column=);

Data Diff_Group_1;
set &Dataset;
Group=1;
Column_&Report_Column=&First_var;
run;

Data Diff_Group_2;
set &Dataset;
Group=2;
Column_&Report_Column=&Second_var;
run;

Data Diff_Groups;
set Diff_Group_1 Diff_Group_2;
run;

Proc ttest Data=Diff_Groups;
class group;
var Column_&Report_Column;
run;


proc delete data=Diff_Group_1 Diff_Group_2 Diff_Groups ; run;

%mend Difference;






*** Table 1 ***;


Proc  report data=PSDO_RFS.Table_1 ;
column 
year_group Number_of_mutual_funds Number_of_port_holding_stocks Pct_Analyst_coverage Pct_Ind_exp_analyst_coverage Pct_Other_analyst_coverage Pct_of_Mutual_funds Pct_Portfolio_holding_stocks;
format
Number_of_mutual_funds 8.0
Number_of_port_holding_stocks 8.0
Pct_Analyst_coverage percent8.2
Pct_Ind_exp_analyst_coverage percent8.2
Pct_Other_analyst_coverage percent8.2
Pct_of_Mutual_funds percent8.2
Pct_Portfolio_holding_stocks percent8.2;
run;



*** Table 2 ***



** Panel A **;


* Column 1 *;

proc means data=PSDO_RFS.Table_2_Panel_A mean t prt;
var No_Analyst_Cov 
No_Analyst_Cov_DGTW;
run;

* Column 2 *;

proc means data=PSDO_RFS.Table_2_Panel_A mean t prt;
var Any_Analyst_Cov 
Any_Analyst_Cov_DGTW;
run;

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_2_Panel_A, First_var=Any_Analyst_Cov, Second_var=No_Analyst_Cov, Report_Column=3);
%Difference (Dataset=PSDO_RFS.Table_2_Panel_A, First_var=Any_Analyst_Cov_dgtw, Second_var=No_Analyst_Cov_dgtw, Report_Column=3);

* Column 4 *;

proc means data=PSDO_RFS.Table_2_Panel_A mean t prt;
var Ind_Exp_Analyst_Cov 
Ind_Exp_Analyst_Cov_DGTW;
run;

* Column 5 *;

%Difference (Dataset=PSDO_RFS.Table_2_Panel_A, First_var=Ind_Exp_Analyst_Cov, Second_var=No_Analyst_Cov, Report_Column=5);
%Difference (Dataset=PSDO_RFS.Table_2_Panel_A, First_var=Ind_Exp_Analyst_Cov_dgtw, Second_var=No_Analyst_Cov_dgtw, Report_Column=5);

* Column 6 *;

proc means data=PSDO_RFS.Table_2_Panel_A mean t prt;
var Other_Analyst_Cov 
Other_Analyst_Cov_DGTW;
run;

* Column 7 *;

%Difference (Dataset=PSDO_RFS.Table_2_Panel_A, First_var=Other_Analyst_Cov, Second_var=No_Analyst_Cov, Report_Column=7);
%Difference (Dataset=PSDO_RFS.Table_2_Panel_A, First_var=Other_Analyst_Cov_dgtw, Second_var=No_Analyst_Cov_dgtw, Report_Column=7);

* Column 8 *;

%Difference (Dataset=PSDO_RFS.Table_2_Panel_A, First_var=Ind_Exp_Analyst_Cov, Second_var=Other_Analyst_Cov, Report_Column=8);
%Difference (Dataset=PSDO_RFS.Table_2_Panel_A, First_var=Ind_Exp_Analyst_Cov_dgtw, Second_var=Other_Analyst_Cov_dgtw, Report_Column=8);




** Panel B **;


* Column 1 *;

proc means data=PSDO_RFS.Table_2_Panel_B mean t prt;
var Ind_Exp_Analyst_Cov 
Ind_Exp_Analyst_Cov_dgtw ;
run;

* Column 2 *;

proc means data=PSDO_RFS.Table_2_Panel_B mean t prt;
var Other_Brk_Ind_Exp_Ana_Cov 
Other_Brk_Ind_Exp_Ana_Cov_dgtw;
run;

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_2_Panel_B, First_var=Ind_Exp_Analyst_Cov, Second_var=Other_Brk_Ind_Exp_Ana_Cov, Report_Column=3);
%Difference (Dataset=PSDO_RFS.Table_2_Panel_B, First_var=Ind_Exp_Analyst_Cov_dgtw, Second_var=Other_Brk_Ind_Exp_Ana_Cov_dgtw, Report_Column=3);

* Column 4 *;

proc means data=PSDO_RFS.Table_2_Panel_B mean t prt;
var Ind_Exp_Analyst_VIP_Cov 
Ind_Exp_Analyst_VIP_Cov_dgtw;
run;

* Column 5 *;

proc means data=PSDO_RFS.Table_2_Panel_B mean t prt;
var Ind_Exp_Analyst_Non_VIP_Cov 
Ind_Exp_Analyst_Non_VIP_Cov_dgtw;
run;

* Column 6 *;

%Difference (Dataset=PSDO_RFS.Table_2_Panel_B, First_var=Ind_Exp_Analyst_Non_VIP_Cov, Second_var=Ind_Exp_Analyst_VIP_Cov, Report_Column=6);
%Difference (Dataset=PSDO_RFS.Table_2_Panel_B, First_var=Ind_Exp_Analyst_Non_VIP_Cov_dgtw, Second_var=Ind_Exp_Analyst_VIP_Cov_dgtw, Report_Column=6);




*** Table 3 ***;


** Panel A **;


* Column 1 *;

Proc means data=PSDO_RFS.Table_3_Panel_A_senior_CS_Sample mean t prt;
var Senior_Position Senior_Position_DGTW;
run;

* Column 2 *;

Proc means data=PSDO_RFS.Table_3_Panel_A_senior_CS_Sample mean t prt;
var Other_position  Other_position_DGTW;
run;

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_3_Panel_A_senior_CS_Sample, First_var=Senior_Position, Second_var=Other_position, Report_Column=3);
%Difference (Dataset=PSDO_RFS.Table_3_Panel_A_senior_CS_Sample, First_var=Senior_Position_DGTW, Second_var=Other_position_DGTW, Report_Column=3);


* Column 4 *;

Proc means data=PSDO_RFS.Table_3_Panel_A_Multi_CS_Sample mean t prt;
var Multiple_pre_analyst_firms  Multiple_pre_analyst_firms_DGTW;
run;

* Column 5 *;

Proc means data=PSDO_RFS.Table_3_Panel_A_Multi_CS_Sample mean t prt;
var Single_pre_analyst_firm  Single_pre_analyst_firm_DGTW;
run;

* Column 6 *;

%Difference (Dataset=PSDO_RFS.Table_3_Panel_A_Multi_CS_Sample, First_var=Multiple_pre_analyst_firms, Second_var=Single_pre_analyst_firm, Report_Column=6);
%Difference (Dataset=PSDO_RFS.Table_3_Panel_A_Multi_CS_Sample, First_var=Multiple_pre_analyst_firms_DGTW, Second_var=Single_pre_analyst_firm_DGTW, Report_Column=6);


* Column 7 *;

Proc means data=PSDO_RFS.Table_3_Panel_A_Public_CS_Sample mean t prt;
var Public_pre_analyst_firm Public_pre_analyst_firm_DGTW;
run;

* Column 8 *;

Proc means data=PSDO_RFS.Table_3_Panel_A_Public_CS_Sample mean t prt;
var Private_pre_analyst_firm  Private_pre_analyst_firm_DGTW;
run;

* Column 9 *;

%Difference (Dataset=PSDO_RFS.Table_3_Panel_A_Public_CS_Sample, First_var=Public_pre_analyst_firm, Second_var=Private_pre_analyst_firm, Report_Column=9);
%Difference (Dataset=PSDO_RFS.Table_3_Panel_A_Public_CS_Sample, First_var=Public_pre_analyst_firm_DGTW, Second_var=Private_pre_analyst_firm_DGTW, Report_Column=9);




** Panel B **;


* Column 1 *;

Proc means data=PSDO_RFS.Table_3_Panel_B_Rec_P_CS_Sample mean t prt;
var High_Rec_Profit High_Rec_Profit_dgtw  ;
run;

* Column 2 *;

Proc means data=PSDO_RFS.Table_3_Panel_B_Rec_P_CS_Sample mean t prt;
var Low_Rec_Profit Low_Rec_Profit_dgtw ;
run;

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_3_Panel_B_Rec_P_CS_Sample, First_var=High_Rec_Profit, Second_var=Low_Rec_Profit, Report_Column=3);
%Difference (Dataset=PSDO_RFS.Table_3_Panel_B_Rec_P_CS_Sample, First_var=High_Rec_Profit_dgtw, Second_var=Low_Rec_Profit_dgtw, Report_Column=3);


* Column 4 *;

Proc means data=PSDO_RFS.Table_3_Panel_B_EPS_A_CS_Sample mean t prt;
var High_forecast_accuracy High_forecast_accuracy_dgtw ;
run;

* Column 5 *;

Proc means data=PSDO_RFS.Table_3_Panel_B_EPS_A_CS_Sample mean t prt;
var Low_forecast_accuracy  Low_forecast_accuracy_dgtw ;
run;

* Column 6 *;

%Difference (Dataset=PSDO_RFS.Table_3_Panel_B_EPS_A_CS_Sample, First_var=High_forecast_accuracy, Second_var=Low_forecast_accuracy, Report_Column=6);
%Difference (Dataset=PSDO_RFS.Table_3_Panel_B_EPS_A_CS_Sample, First_var=High_forecast_accuracy_dgtw, Second_var=Low_forecast_accuracy_dgtw, Report_Column=6);




** Panel C **;



* Column 1 *;

Proc means data=PSDO_RFS.Table_3_Panel_C_EPS_S_CS_Sample mean t prt;
var High_EPS_synch High_EPS_synch_DGTW;
run;

* Column 2 *;

Proc means data=PSDO_RFS.Table_3_Panel_C_EPS_S_CS_Sample mean t prt;
var Low_EPS_synch  Low_EPS_synch_DGTW;
run;

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_3_Panel_C_EPS_S_CS_Sample, First_var=High_EPS_synch, Second_var=Low_EPS_synch, Report_Column=3);
%Difference (Dataset=PSDO_RFS.Table_3_Panel_C_EPS_S_CS_Sample, First_var=High_EPS_synch_DGTW, Second_var=Low_EPS_synch_DGTW, Report_Column=3);


* Column 4 *;

Proc means data=PSDO_RFS.Table_3_Panel_C_Ret_S_CS_Sample mean t prt;
var High_Ret_synch  High_Ret_synch_DGTW;
run;

* Column 5 *;

Proc means data=PSDO_RFS.Table_3_Panel_C_Ret_S_CS_Sample mean t prt;
var Low_Ret_synch  Low_Ret_synch_DGTW;
run;

* Column 6 *;

%Difference (Dataset=PSDO_RFS.Table_3_Panel_C_Ret_S_CS_Sample, First_var=High_Ret_synch, Second_var=Low_Ret_synch, Report_Column=6);
%Difference (Dataset=PSDO_RFS.Table_3_Panel_C_Ret_S_CS_Sample, First_var=High_Ret_synch_DGTW, Second_var=Low_Ret_synch_DGTW, Report_Column=6);






** Panel D **;


* Column 1 *;

Proc means data=PSDO_RFS.Table_3_Panel_D_Cnct_CS_Sample mean t prt;
var Connected Connected_DGTW;
run;

* Column 2 *;

Proc means data=PSDO_RFS.Table_3_Panel_D_Cnct_CS_Sample mean t prt;
var  Not_Connected Not_Connected_DGTW;
run;

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_3_Panel_D_Cnct_CS_Sample, First_var=Connected, Second_var=Not_Connected, Report_Column=3);
%Difference (Dataset=PSDO_RFS.Table_3_Panel_D_Cnct_CS_Sample, First_var=Connected_DGTW, Second_var=Not_Connected_DGTW, Report_Column=3);


* Column 4 *;

Proc means data=PSDO_RFS.Table_3_Panel_D_1EC_Q_CS_Sample mean t prt;
var First_EC_Q  First_EC_Q_DGTW;
run;

* Column 5 *;

Proc means data=PSDO_RFS.Table_3_Panel_D_1EC_Q_CS_Sample mean t prt;
var Non_First_EC_Q  Non_First_EC_Q_DGTW;
run;

* Column 6 *;

%Difference (Dataset=PSDO_RFS.Table_3_Panel_D_1EC_Q_CS_Sample, First_var=First_EC_Q, Second_var=Non_First_EC_Q, Report_Column=6);
%Difference (Dataset=PSDO_RFS.Table_3_Panel_D_1EC_Q_CS_Sample, First_var=First_EC_Q_DGTW, Second_var=Non_First_EC_Q_DGTW, Report_Column=6);


* Column 7 *;

Proc means data=PSDO_RFS.Table_3_Panel_D_T_RPT_CS_Sample mean t prt;
var Takeaway_report  Takeaway_report_DGTW;
run;

* Column 8 *;

Proc means data=PSDO_RFS.Table_3_Panel_D_T_RPT_CS_Sample mean t prt;
var No_Takeaway_report  No_Takeaway_report_DGTW;
run;

* Column 9 *;

%Difference (Dataset=PSDO_RFS.Table_3_Panel_D_T_RPT_CS_Sample, First_var=Takeaway_report, Second_var=No_Takeaway_report, Report_Column=9);
%Difference (Dataset=PSDO_RFS.Table_3_Panel_D_T_RPT_CS_Sample, First_var=Takeaway_report_DGTW, Second_var=No_Takeaway_report_DGTW, Report_Column=9);







*** Table 4 ***;



** Panel A **;


* Column 1 *;

Proc means data=PSDO_RFS.Table_4_Panel_A mean t prt;
var Ind_Exp_Analyst_Cov Ind_Exp_Analyst_Cov_DGTW ;
run;

* Column 2 *;

Proc means data=PSDO_RFS.Table_4_Panel_A mean t prt;
var  No_Analyst_Cov  No_Analyst_Cov_DGTW ;
run;

* Column 3 *;

Proc means data=PSDO_RFS.Table_4_Panel_A mean t prt;
var Other_Analyst_Cov Other_Analyst_Cov_DGTW;
run;

* Column 4 *;

%Difference (Dataset=PSDO_RFS.Table_4_Panel_A, First_var=Ind_Exp_Analyst_Cov, Second_var=No_Analyst_Cov, Report_Column=4);
%Difference (Dataset=PSDO_RFS.Table_4_Panel_A, First_var=Ind_Exp_Analyst_Cov_DGTW, Second_var=No_Analyst_Cov_DGTW, Report_Column=4);

* Column 5 *;

%Difference (Dataset=PSDO_RFS.Table_4_Panel_A, First_var=Ind_Exp_Analyst_Cov, Second_var=Other_Analyst_Cov, Report_Column=5);
%Difference (Dataset=PSDO_RFS.Table_4_Panel_A, First_var=Ind_Exp_Analyst_Cov_DGTW, Second_var=Other_Analyst_Cov_DGTW, Report_Column=5);

* Column 6 *;

%Difference (Dataset=PSDO_RFS.Table_4_Panel_A, First_var=Ind_Exp_Analyst_Cov, Second_var=Other_Brk_Ind_Exp_Analyst_Cov, Report_Column=6);
%Difference (Dataset=PSDO_RFS.Table_4_Panel_A, First_var=Ind_Exp_Analyst_Cov_DGTW, Second_var=Other_Brk_Ind_Exp_Ana_Cov_dgtw, Report_Column=6);

* Column 7 *;

%Difference (Dataset=PSDO_RFS.Table_4_Panel_A, First_var=Ind_Exp_Analyst_VIP_Cov, Second_var=Ind_Exp_Analyst_Non_VIP_Cov, Report_Column=7);
%Difference (Dataset=PSDO_RFS.Table_4_Panel_A, First_var=Ind_Exp_Analyst_VIP_Cov_DGTW, Second_var=Ind_Exp_Analyst_Non_VIP_Cov_DGTW, Report_Column=7);





** Panel B **;


* Column 1 *;

proc means data=PSDO_RFS.Table_4_Panel_B mean t prt;
var LS_Ret_did LS_dgtw_adj_Ret_did;
run;

* Column 2 *;

proc means data=PSDO_RFS.Table_4_Panel_B mean t prt;
Where Lost_industry_expert_analyst=1;
var LS_Ret_did LS_dgtw_adj_Ret_did;
run;

* Column 3 *;

proc means data=PSDO_RFS.Table_4_Panel_B mean t prt;
Where Lost_industry_expert_analyst=0;
var LS_Ret_did LS_dgtw_adj_Ret_did;
run;

* Column 4 *;

proc ttest data=PSDO_RFS.Table_4_Panel_B;
Class Lost_industry_expert_analyst;
var LS_Ret_did LS_dgtw_adj_Ret_did;
run;



** Panel C **;


* Column 1 *;

proc means data=PSDO_RFS.Table_4_Panel_C mean t prt;
var LS_Ret_did LS_dgtw_adj_Ret_did;
run;

* Column 2 *;

proc means data=PSDO_RFS.Table_4_Panel_C mean t prt;
Where Lost_industry_expert_analyst=1;
var LS_Ret_did LS_dgtw_adj_Ret_did;
run;

* Column 3 *;

proc means data=PSDO_RFS.Table_4_Panel_C mean t prt;
Where Lost_industry_expert_analyst=0;
var LS_Ret_did LS_dgtw_adj_Ret_did;
run;

* Column 4 *;

proc ttest data=PSDO_RFS.Table_4_Panel_C;
Class Lost_industry_expert_analyst;
var LS_Ret_did LS_dgtw_adj_Ret_did;
run;






**** Table 5 ****;



** Panel A **;


* Column 1 *;

Proc means data= PSDO_RFS.Table_5_Panel_A  mean t prt ;
var Ind_Exp_Analyst_LS Ind_Exp_Analyst_LS_dgtw ; 
run;

* Column 2 *;

%Difference (Dataset=PSDO_RFS.Table_5_Panel_A, First_var=Ind_Exp_Analyst_LS, Second_var=No_Analyst_LS, Report_Column=2);
%Difference (Dataset=PSDO_RFS.Table_5_Panel_A, First_var=Ind_Exp_Analyst_LS_DGTW, Second_var=No_Analyst_LS_DGTW, Report_Column=2);

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_5_Panel_A, First_var=Ind_Exp_Analyst_LS, Second_var=Other_Analyst_LS, Report_Column=3);
%Difference (Dataset=PSDO_RFS.Table_5_Panel_A, First_var=Ind_Exp_Analyst_LS_DGTW, Second_var=Other_Analyst_LS_dgtw, Report_Column=3);

* Column 4 *;

%Difference (Dataset=PSDO_RFS.Table_5_Panel_A, First_var=Ind_Exp_Analyst_LS, Second_var=Other_Brk_Ind_Exp_Ana_LS, Report_Column=4);
%Difference (Dataset=PSDO_RFS.Table_5_Panel_A, First_var=Ind_Exp_Analyst_LS_DGTW, Second_var=Other_Brk_Ind_Exp_Ana_LS_dgtw, Report_Column=4);

* Column 5 *;

%Difference (Dataset=PSDO_RFS.Table_5_Panel_A, First_var=Ind_Exp_Analyst_VIP_LS, Second_var=Ind_Exp_Analyst_Non_VIP_LS, Report_Column=5);
%Difference (Dataset=PSDO_RFS.Table_5_Panel_A, First_var=Ind_Exp_Analyst_VIP_LS_dgtw, Second_var=Ind_Exp_Analyst_Non_VIP_LS_DGTW, Report_Column=5);



** Panel B **;


* Column 1 *;

Proc means data= PSDO_RFS.Table_5_Panel_B  mean t prt ;
var Ind_Exp_Analyst_LS Ind_Exp_Analyst_LS_dgtw ; 
run;

* Column 2 *;

%Difference (Dataset=PSDO_RFS.Table_5_Panel_B, First_var=Ind_Exp_Analyst_LS, Second_var=No_Analyst_LS, Report_Column=2);
%Difference (Dataset=PSDO_RFS.Table_5_Panel_B, First_var=Ind_Exp_Analyst_LS_DGTW, Second_var=No_Analyst_LS_DGTW, Report_Column=2);

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_5_Panel_B, First_var=Ind_Exp_Analyst_LS, Second_var=Other_Analyst_LS, Report_Column=3);
%Difference (Dataset=PSDO_RFS.Table_5_Panel_B, First_var=Ind_Exp_Analyst_LS_DGTW, Second_var=Other_Analyst_LS_dgtw, Report_Column=3);

* Column 4 *;

%Difference (Dataset=PSDO_RFS.Table_5_Panel_B, First_var=Ind_Exp_Analyst_LS, Second_var=Other_Brk_Ind_Exp_Ana_LS, Report_Column=4);
%Difference (Dataset=PSDO_RFS.Table_5_Panel_B, First_var=Ind_Exp_Analyst_LS_DGTW, Second_var=Other_Brk_Ind_Exp_Ana_LS_dgtw, Report_Column=4);

* Column 5 *;

%Difference (Dataset=PSDO_RFS.Table_5_Panel_B, First_var=Ind_Exp_Analyst_VIP_LS, Second_var=Ind_Exp_Analyst_Non_VIP_LS, Report_Column=5);
%Difference (Dataset=PSDO_RFS.Table_5_Panel_B, First_var=Ind_Exp_Analyst_VIP_LS_dgtw, Second_var=Ind_Exp_Analyst_Non_VIP_LS_DGTW, Report_Column=5);






*** Table 6 ***;


** Panel A **;

* Column 1 *;

Proc sort data=PSDO_RFS.Table_6_panel_A;
by fund_dummy;
run;

proc glm data=PSDO_RFS.Table_6_panel_A;
absorb fund_dummy;
class YQ_Dummy ;
model pct_wt=Analyst_Coverage Pct_style Size BM past_ret liquidity YQ_Dummy /solution;
run;
quit;

* Column 2 *;

proc glm data=PSDO_RFS.Table_6_panel_A;
absorb fund_dummy;
class YQ_Dummy ;
model pct_wt=Industry_expert_analyst_Coverage Other_analyst_Coverage Pct_style Size BM past_ret liquidity YQ_Dummy /solution;
run;
quit;


** Panel B **;

* Column 1 *;

proc means data=PSDO_RFS.Table_6_panel_B mean t prt  ;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 

* Column 2 *;

proc means data=PSDO_RFS.Table_6_panel_B mean t prt  ;
Where Lost_Industry_Expert_Analyst=1;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 

* Column 3 *;

proc means data=PSDO_RFS.Table_6_panel_B mean t prt  ;
Where Lost_Industry_Expert_Analyst=0;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 

* Column 4 *;

proc ttest data=PSDO_RFS.Table_6_panel_B    ;
class Lost_Industry_Expert_Analyst;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 


** Panel C **;

* Column 1 *;

proc means data=PSDO_RFS.Table_6_panel_C mean t prt  ;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 

* Column 2 *;

proc means data=PSDO_RFS.Table_6_panel_C mean t prt  ;
Where Lost_Industry_Expert_Analyst=1;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 

* Column 3 *;

proc means data=PSDO_RFS.Table_6_panel_C mean t prt  ;
Where Lost_Industry_Expert_Analyst=0;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 

* Column 4 *;

proc ttest data=PSDO_RFS.Table_6_panel_C    ;
class Lost_Industry_Expert_Analyst;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 






*** Table 7 ***;


** Panel A **;


* Column 1 *;

Proc surveyreg Data=PSDO_RFS.Table_7_panel_A;
class Year_Dummy Broker_dummy ;
cluster Fund_Dummy;
model bratio_1= Pct_Analyst_Cov  top10 bratio equity_ind_cov_weight_pct Ind_expt_brk all_star_cov_weight_pct leader_cov_weight_pct  high_rev_freq_cov_weight_pct  long_gexp_cov_weight_pct large_port_cov_weight_pct 
year_dummy Broker_dummy/solution;
run; 

* Column 2 *;

Proc surveyreg Data=PSDO_RFS.Table_7_panel_A;
class Year_Dummy Broker_dummy ;
cluster Fund_Dummy;
model bratio_1= Pct_Industry_expert_analyst_Cov Pct_Other_analyst_Cov top10 bratio equity_ind_cov_weight_pct Ind_expt_brk all_star_cov_weight_pct leader_cov_weight_pct  high_rev_freq_cov_weight_pct  long_gexp_cov_weight_pct large_port_cov_weight_pct 
year_dummy Broker_dummy/solution;
contrast 'Industry Expert Analyst = Other Analyst' Pct_Industry_expert_analyst_Cov 1 Pct_Other_analyst_Cov-1;
run; 

* Column 3 *;

Proc surveyreg Data=PSDO_RFS.Table_7_panel_A;
class Year_Dummy Broker_dummy ;
cluster Fund_Dummy;
model bratio_1= Pct_Ind_exp_analyst_high_P_Cov Pct_Ind_exp_analyst_low_P_Cov Pct_Other_analyst_Cov 
top10 bratio equity_ind_cov_weight_pct Ind_expt_brk all_star_cov_weight_pct leader_cov_weight_pct  high_rev_freq_cov_weight_pct  long_gexp_cov_weight_pct
large_port_cov_weight_pct optimistic_cov_weight_pct bold_cov_weight_pct  MBA_cov_weight_pct high_accuracy_cov_weight_pct ivy_league_cov_weight_pct  
year_dummy Broker_dummy/solution;
contrast 'Industry Expert Analyst (High)= Industry Expert Analyst (Low)' Pct_Ind_exp_analyst_high_P_Cov 1 Pct_Ind_exp_analyst_low_P_Cov-1;
run; 

* Column 4 *;

Proc surveyreg Data=PSDO_RFS.Table_7_panel_A;
class Year_Dummy Broker_dummy ;
cluster Fund_Dummy;
model bratio_1= Pct_Industry_expert_analyst_Cov Pct_Other_analyst_Cov  
top10 bratio equity_ind_cov_weight_pct Ind_expt_brk all_star_cov_weight_pct leader_cov_weight_pct  high_rev_freq_cov_weight_pct  long_gexp_cov_weight_pct
large_port_cov_weight_pct optimistic_cov_weight_pct bold_cov_weight_pct 
year_dummy Broker_dummy/solution;
contrast 'Industry Expert Analyst = Other Analyst' Pct_Industry_expert_analyst_Cov 1 Pct_Other_analyst_Cov-1;
run; 

* Column 5 *;

Proc surveyreg Data=PSDO_RFS.Table_7_panel_A;
class Year_Dummy Broker_dummy ;
cluster Fund_Dummy;
model bratio_1= Pct_Industry_expert_analyst_Cov Pct_Other_analyst_Cov  
top10 bratio equity_ind_cov_weight_pct Ind_expt_brk all_star_cov_weight_pct leader_cov_weight_pct  high_rev_freq_cov_weight_pct  long_gexp_cov_weight_pct
large_port_cov_weight_pct optimistic_cov_weight_pct bold_cov_weight_pct  MBA_cov_weight_pct high_accuracy_cov_weight_pct ivy_league_cov_weight_pct 
year_dummy Broker_dummy/solution;
contrast 'Industry Expert Analyst = Other Analyst' Pct_Industry_expert_analyst_Cov 1 Pct_Other_analyst_Cov-1;
run; 

* Column 6 *;

Proc surveyreg Data=PSDO_RFS.Table_7_panel_A;
class Year_Dummy Broker_dummy Fund_Dummy;
model bratio_1= Pct_Industry_expert_analyst_Cov Pct_Other_analyst_Cov  
top10 bratio equity_ind_cov_weight_pct Ind_expt_brk all_star_cov_weight_pct leader_cov_weight_pct  high_rev_freq_cov_weight_pct  long_gexp_cov_weight_pct
large_port_cov_weight_pct optimistic_cov_weight_pct bold_cov_weight_pct  MBA_cov_weight_pct high_accuracy_cov_weight_pct ivy_league_cov_weight_pct 
year_dummy Broker_dummy Fund_Dummy/solution;
contrast 'Industry Expert Analyst = Other Analyst' Pct_Industry_expert_analyst_Cov 1 Pct_Other_analyst_Cov-1;
run; 

* Column 7 *; /* Switched to GLM due to large number of Fund-year Dummies */

proc sort data=PSDO_RFS.Table_7_panel_A;
by Fund_year_Dummy;
run;

Proc glm Data=PSDO_RFS.Table_7_panel_A;
class  Broker_dummy ;
absorb Fund_year_Dummy;
model bratio_1= Pct_Industry_expert_analyst_Cov Pct_Other_analyst_Cov  top10 bratio 
equity_ind_cov_weight_pct Ind_expt_brk all_star_cov_weight_pct leader_cov_weight_pct  high_rev_freq_cov_weight_pct  long_gexp_cov_weight_pct
large_port_cov_weight_pct optimistic_cov_weight_pct bold_cov_weight_pct  MBA_cov_weight_pct high_accuracy_cov_weight_pct ivy_league_cov_weight_pct  Broker_dummy /solution;
contrast 'Industry Expert Analyst = Other Analyst' Pct_Industry_expert_analyst_Cov 1 Pct_Other_analyst_Cov-1;
run; 
quit;



** Panel B **;

* Column 1 *;

proc means data=PSDO_RFS.Table_7_panel_B mean t prt  ;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 

* Column 2 *;

proc means data=PSDO_RFS.Table_7_panel_B mean t prt  ;
Where Lost_Industry_Expert_Analyst=1;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 

* Column 3 *;

proc means data=PSDO_RFS.Table_7_panel_B mean t prt  ;
Where Lost_Industry_Expert_Analyst=0;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 

* Column 4 *;

proc ttest data=PSDO_RFS.Table_7_panel_B    ;
class Lost_Industry_Expert_Analyst;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 



** Panel C **;

* Column 1 *;

proc means data=PSDO_RFS.Table_7_panel_C mean t prt  ;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 

* Column 2 *;

proc means data=PSDO_RFS.Table_7_panel_C mean t prt  ;
Where Lost_Industry_Expert_Analyst=1;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 

* Column 3 *;

proc means data=PSDO_RFS.Table_7_panel_C mean t prt  ;
Where Lost_Industry_Expert_Analyst=0;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 

* Column 4 *;

proc ttest data=PSDO_RFS.Table_7_panel_C    ;
class Lost_Industry_Expert_Analyst;
var Mean_Treatment_Difference Mean_Control_Difference Mean_DiD;
run; 




*** Table 8 ***;


* Model 1 *;

proc surveylogistic data =PSDO_RFS.Table_8;
class year_Dummy broker_Dummy;
cluster Fund_Dummy;
model executed_Non_expert_ind_cov(event="1") =  Ind_Exp_Analyst_Cov_Other_brk Pct_Ind_Exp_A_Cov_Other_Stk affiliated top10 Ind_expt_brk bratio year_Dummy broker_Dummy / rsq link = logit;
run;

* Model 2 *;

proc surveylogistic data =  PSDO_RFS.Table_8;
class year_Dummy broker_Dummy;
cluster Fund_Dummy;
model executed_Non_expert_ind_cov(event="1") = Ind_Exp_Analyst_Cov_Other_brk Pct_Ind_Exp_A_Cov_Other_Stk affiliated top10 Ind_expt_brk bratio all_star leader freq_rev long_gexp large_port optimistic bold_analyst year_Dummy broker_Dummy/rsq  link = logit;
run;

* Model 3 *;

proc surveylogistic data =  PSDO_RFS.Table_8;
class year_Dummy broker_Dummy;
cluster Fund_Dummy;
model executed_Non_expert_ind_cov(event="1") = Ind_Exp_Analyst_Cov_Other_brk Pct_Ind_Exp_A_Cov_Other_Stk affiliated top10 Ind_expt_brk bratio all_star leader freq_rev long_gexp large_port optimistic bold_analyst  MBA high_accuracy ivy_league year_Dummy broker_Dummy/rsq  link = logit;
run;




*** Table 9 ***;



** Panel A **;


* Column 1 *;

proc means data=PSDO_RFS.Table_9_Panel_A mean  t prt;
var Ind_Exp_Analyst_Cov Ind_Exp_Analyst_Cov_dgtw  ;
run;

* Column 2 *;

proc means data=PSDO_RFS.Table_9_Panel_A mean  t prt;
var Other_Analyst_Cov Other_Analyst_Cov_DGTW  ;
run;

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_9_Panel_A, First_var=Ind_Exp_Analyst_Cov, Second_var=Other_Analyst_Cov, Report_Column=3);
%Difference (Dataset=PSDO_RFS.Table_9_Panel_A, First_var=Ind_Exp_Analyst_Cov_dgtw, Second_var=Other_Analyst_Cov_DGTW, Report_Column=3);



** Panel B **;


* Column 1 *;

proc means data=PSDO_RFS.Table_9_Panel_B mean t prt;
where Synch_high=1;
var Ind_Exp_Analyst_Cov Ind_Exp_Analyst_Cov_DGTW ;
run;

* Column 2 *;

proc means data=PSDO_RFS.Table_9_Panel_B mean t prt;
where Synch_high=1;
var Other_Analyst_Cov Other_Analyst_Cov_DGTW  ;
run;

* Column 3 *;

proc means data=PSDO_RFS.Table_9_Panel_B mean t prt;
where Synch_high=1;
var Ind_Exp_Vs_Other_analyst  Ind_Exp_Vs_Other_analyst_DGTW ;
run;

* Column 4 *;

proc means data=PSDO_RFS.Table_9_Panel_B mean t prt;
where Synch_high=0;
var Ind_Exp_Analyst_Cov Ind_Exp_Analyst_Cov_DGTW ;
run;

* Column 5 *;

proc means data=PSDO_RFS.Table_9_Panel_B mean t prt;
where Synch_high=0;
var Other_Analyst_Cov Other_Analyst_Cov_DGTW  ;
run;

* Column 6 *;

proc means data=PSDO_RFS.Table_9_Panel_B mean t prt;
where Synch_high=0;
var Ind_Exp_Vs_Other_analyst  Ind_Exp_Vs_Other_analyst_DGTW ;
run;

* Column 7 *; 

proc ttest data= PSDO_RFS.Table_9_Panel_B;
class Synch_high;
var Ind_Exp_Analyst_Cov Ind_Exp_Analyst_Cov_DGTW;
run;



** Panel C **;


* Column 1 *;

Proc means data=PSDO_RFS.Table_9_Panel_C mean t prt ;
var  Ind_Exp_Analyst_Cov   Ind_Exp_Analyst_Cov_DGTW; 
run;

* Column 2 *;

Proc means data=PSDO_RFS.Table_9_Panel_C mean t prt ;
var  Other_Analyst_Cov   Other_Analyst_Cov_DGTW; 
run;

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_9_Panel_C, First_var=Ind_Exp_Analyst_Cov, Second_var=Other_Analyst_Cov, Report_Column=3);
%Difference (Dataset=PSDO_RFS.Table_9_Panel_C, First_var=Ind_Exp_Analyst_Cov_dgtw, Second_var=Other_Analyst_Cov_DGTW, Report_Column=3);




** Panel D **;


* Column 1 *;

proc means data=PSDO_RFS.Table_9_Panel_D mean t prt;
where Synch_high=1;
var Ind_Exp_Analyst_Cov Ind_Exp_Analyst_Cov_DGTW ;
run;

* Column 2 *;

proc means data=PSDO_RFS.Table_9_Panel_D mean t prt;
where Synch_high=1;
var Other_Analyst_Cov Other_Analyst_Cov_DGTW  ;
run;

* Column 3 *;

proc means data=PSDO_RFS.Table_9_Panel_D mean t prt;
where Synch_high=1;
var Ind_Exp_Vs_Other_analyst  Ind_Exp_Vs_Other_analyst_DGTW ;
run;

* Column 4 *;

proc means data=PSDO_RFS.Table_9_Panel_D mean t prt;
where Synch_high=0;
var Ind_Exp_Analyst_Cov Ind_Exp_Analyst_Cov_DGTW ;
run;

* Column 5 *;

proc means data=PSDO_RFS.Table_9_Panel_D mean t prt;
where Synch_high=0;
var Other_Analyst_Cov Other_Analyst_Cov_DGTW  ;
run;

* Column 6 *;

proc means data=PSDO_RFS.Table_9_Panel_D mean t prt;
where Synch_high=0;
var Ind_Exp_Vs_Other_analyst  Ind_Exp_Vs_Other_analyst_DGTW ;
run;

* Column 7 *;

proc ttest data= PSDO_RFS.Table_9_Panel_D;
class Synch_high;
var Ind_Exp_Analyst_Cov Ind_Exp_Analyst_Cov_DGTW;
run;








*** Appendix Table A1 ***;


** Panel A **;


* Column 1 *;

Proc means data=PSDO_RFS.Table_A1_Panel_A mean t prt  ;
where Column=1;
class factor_model;
var Alpha;
run;

* Column 2 *;

Proc means data=PSDO_RFS.Table_A1_Panel_A mean t prt  ;
where Column=2;
class factor_model;
var Alpha;
run;

* Column 3 *;

Proc ttest data=PSDO_RFS.Table_A1_Panel_A  ;
where Column=1 or Column=2;
by factor_model;
class Column;
var Alpha;
run;

* Column 4 *;

Proc means data=PSDO_RFS.Table_A1_Panel_A mean t prt  ;
where Column=4;
class factor_model;
var Alpha;
run;

* Column 5 *;

Proc ttest data=PSDO_RFS.Table_A1_Panel_A  ;
where Column=1 or Column=4;
by factor_model;
class Column;
var Alpha;
run;

* Column 6 *;

Proc means data=PSDO_RFS.Table_A1_Panel_A mean t prt  ;
where Column=6;
class factor_model;
var Alpha;
run;

* Column 7 *;

Proc ttest data=PSDO_RFS.Table_A1_Panel_A  ;
where Column=6 or Column=1;
by factor_model;
class Column;
var Alpha;
run;

* Column 8 *;

Proc ttest data=PSDO_RFS.Table_A1_Panel_A  ;
where Column=6 or Column=4;
by factor_model;
class Column;
var Alpha;
run;




** Panel B **;



* Column 1 *;

proc means data=PSDO_RFS.Table_A1_Panel_B mean t prt;
var No_Analyst_Cov ;
run;

* Column 2 *;

proc means data=PSDO_RFS.Table_A1_Panel_B mean t prt;
var Any_Analyst_Cov ;
run;

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_A1_Panel_B, First_var=Any_Analyst_Cov, Second_var=No_Analyst_Cov, Report_Column=3);

* Column 4 *;

proc means data=PSDO_RFS.Table_A1_Panel_B mean t prt;
var Ind_Exp_Analyst_Cov ;
run;

* Column 5 *;

%Difference (Dataset=PSDO_RFS.Table_A1_Panel_B, First_var=Ind_Exp_Analyst_Cov, Second_var=No_Analyst_Cov, Report_Column=5);

* Column 6 *;

proc means data=PSDO_RFS.Table_A1_Panel_B mean t prt;
var Other_Analyst_Cov ;
run;

* Column 7 *;

%Difference (Dataset=PSDO_RFS.Table_A1_Panel_B, First_var=Other_Analyst_Cov, Second_var=No_Analyst_Cov, Report_Column=7);

* Column 8 *;

%Difference (Dataset=PSDO_RFS.Table_A1_Panel_B, First_var=Ind_Exp_Analyst_Cov, Second_var=Other_Analyst_Cov, Report_Column=8);





*** Appendix Table A2 ***;


** Panel A **;


* Column 1 *;

proc means data=PSDO_RFS.Table_A2_Panel_A mean t prt;
var No_Analyst_Cov 
No_Analyst_Cov_DGTW;
run;

* Column 2 *;

proc means data=PSDO_RFS.Table_A2_Panel_A mean t prt;
var Any_Analyst_Cov 
Any_Analyst_Cov_DGTW;
run;

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_A2_Panel_A, First_var=Any_Analyst_Cov, Second_var=No_Analyst_Cov, Report_Column=3);
%Difference (Dataset=PSDO_RFS.Table_A2_Panel_A, First_var=Any_Analyst_Cov_dgtw, Second_var=No_Analyst_Cov_dgtw, Report_Column=3);

* Column 4 *;

proc means data=PSDO_RFS.Table_A2_Panel_A mean t prt;
var Ind_Exp_Analyst_Cov 
Ind_Exp_Analyst_Cov_DGTW;
run;

* Column 5 *;

%Difference (Dataset=PSDO_RFS.Table_A2_Panel_A, First_var=Ind_Exp_Analyst_Cov, Second_var=No_Analyst_Cov, Report_Column=5);
%Difference (Dataset=PSDO_RFS.Table_A2_Panel_A, First_var=Ind_Exp_Analyst_Cov_dgtw, Second_var=No_Analyst_Cov_dgtw, Report_Column=5);

* Column 6 *;

proc means data=PSDO_RFS.Table_A2_Panel_A mean t prt;
var Other_Analyst_Cov 
Other_Analyst_Cov_DGTW;
run;

* Column 7 *;

%Difference (Dataset=PSDO_RFS.Table_A2_Panel_A, First_var=Other_Analyst_Cov, Second_var=No_Analyst_Cov, Report_Column=7);
%Difference (Dataset=PSDO_RFS.Table_a2_Panel_A, First_var=Other_Analyst_Cov_dgtw, Second_var=No_Analyst_Cov_dgtw, Report_Column=7);

* Column 8 *;

%Difference (Dataset=PSDO_RFS.Table_A2_Panel_A, First_var=Ind_Exp_Analyst_Cov, Second_var=Other_Analyst_Cov, Report_Column=8);
%Difference (Dataset=PSDO_RFS.Table_A2_Panel_A, First_var=Ind_Exp_Analyst_Cov_dgtw, Second_var=Other_Analyst_Cov_dgtw, Report_Column=8);



** Panel B **;


* Column 1 *;

proc means data=PSDO_RFS.Table_A2_Panel_B mean t prt;
var Ind_Exp_Analyst_Cov 
Ind_Exp_Analyst_Cov_dgtw ;
run;

* Column 2 *;

proc means data=PSDO_RFS.Table_A2_Panel_B mean t prt;
var Other_Brk_Ind_Exp_Ana_Cov 
Other_Brk_Ind_Exp_Ana_Cov_dgtw;
run;

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_A2_Panel_B, First_var=Ind_Exp_Analyst_Cov, Second_var=Other_Brk_Ind_Exp_Ana_Cov, Report_Column=3);
%Difference (Dataset=PSDO_RFS.Table_A2_Panel_B, First_var=Ind_Exp_Analyst_Cov_dgtw, Second_var=Other_Brk_Ind_Exp_Ana_Cov_dgtw, Report_Column=3);

* Column 4 *;

proc means data=PSDO_RFS.Table_A2_Panel_B mean t prt;
var Ind_Exp_Analyst_VIP_Cov 
Ind_Exp_Analyst_VIP_Cov_dgtw;
run;

* Column 5 *;

proc means data=PSDO_RFS.Table_A2_Panel_B mean t prt;
var Ind_Exp_Analyst_Non_VIP_Cov 
Ind_Exp_Analyst_Non_VIP_Cov_dgtw;
run;

* Column 6 *;

%Difference (Dataset=PSDO_RFS.Table_A2_Panel_B, First_var=Ind_Exp_Analyst_Non_VIP_Cov, Second_var=Ind_Exp_Analyst_VIP_Cov, Report_Column=6);
%Difference (Dataset=PSDO_RFS.Table_A2_Panel_B, First_var=Ind_Exp_Analyst_Non_VIP_Cov_dgtw, Second_var=Ind_Exp_Analyst_VIP_Cov_dgtw, Report_Column=6);





*** Appendix Table A3 ***;


* Column 1 *;

Proc means data= PSDO_RFS.Table_A3  mean t prt ;
var Ind_Exp_Analyst_LS Ind_Exp_Analyst_LS_dgtw; 
run;

* Column 2 *;

Proc means data= PSDO_RFS.Table_A3  mean t prt ;
var No_Analyst_LS No_Analyst_LS_dgtw; 
run;

* Column 3 *;

Proc means data= PSDO_RFS.Table_A3  mean t prt ;
var Other_Analyst_LS Other_Analyst_LS_dgtw; 
run;

* Column 4 *;

%Difference (Dataset=PSDO_RFS.Table_A3, First_var=Ind_Exp_Analyst_LS, Second_var=No_Analyst_LS, Report_Column=4);
%Difference (Dataset=PSDO_RFS.Table_A3, First_var=Ind_Exp_Analyst_LS_DGTW, Second_var=No_Analyst_LS_DGTW, Report_Column=4);

* Column 5 *;

%Difference (Dataset=PSDO_RFS.Table_A3, First_var=Ind_Exp_Analyst_LS, Second_var=Other_Analyst_LS, Report_Column=5);
%Difference (Dataset=PSDO_RFS.Table_A3, First_var=Ind_Exp_Analyst_LS_DGTW, Second_var=Other_Analyst_LS_DGTW, Report_Column=5);

* Column 6 *;

%Difference (Dataset=PSDO_RFS.Table_A3, First_var=Ind_Exp_Analyst_LS, Second_var=Other_Brk_Ind_Exp_Analyst_LS, Report_Column=6);
%Difference (Dataset=PSDO_RFS.Table_A3, First_var=Ind_Exp_Analyst_LS_DGTW, Second_var=Other_Brk_Ind_Exp_Ana_LS_dgtw, Report_Column=6);

* Column 7 *;

%Difference (Dataset=PSDO_RFS.Table_A3, First_var=Ind_Exp_Analyst_VIP_LS, Second_var=Ind_Exp_Analyst_Non_VIP_LS, Report_Column=7);
%Difference (Dataset=PSDO_RFS.Table_A3, First_var=Ind_Exp_Analyst_VIP_LS_DGTW, Second_var=Ind_Exp_Analyst_Non_VIP_LS_DGTW, Report_Column=7);




*** Appendix Table A4 ***;



** Panel A **;

* Column 1 *;

Proc means data=PSDO_RFS.Table_A4_Panel_A  mean t prt;
var  Ind_Exp_Analyst_Cov  Ind_Exp_Analyst_Cov_dgtw ; 
run;

* Column 2 *;

Proc means data=PSDO_RFS.Table_A4_Panel_A  mean t prt;
var Ind_Exp_vs_No_Analyst_Cov  Ind_Exp_vs_No_Analyst_Cov_dgtw ; 
run;

* Column 3 *; 

Proc means data=PSDO_RFS.Table_A4_Panel_A  mean t prt;
var Ind_Exp_vs_Other_A_Cov  Ind_Exp_vs_Other_A_Cov_dgtw ; 
run;


** Panel B **;

* Column 1 *;

Proc means data=PSDO_RFS.Table_A4_panel_B mean t prt ;
var Ind_Exp_Analyst_LS Ind_Exp_Analyst_LS_DGTW ;
run;

* Column 2 *;

Proc means data=PSDO_RFS.Table_A4_panel_B mean t prt ;
var Ind_Exp_vs_No_Analyst_LS Ind_Exp_vs_No_Analyst_LS_DGTW ;
run;

* Column 3 *; 

Proc means data=PSDO_RFS.Table_A4_panel_B mean t prt ;
var Ind_Exp_vs_Other_Analyst_LS Ind_Exp_vs_Other_Analyst_LS_DGTW ;
run;





*** Appendix Table A5 ***;


proc means data=PSDO_RFS.Table_A5 mean;
var top10 Affiliated Same_ind_spec all_star leader  high_rev_freq long_gexp large_port optimistic bold_analyst ;
run;

proc means data=PSDO_RFS.Table_A5 mean;
class year;
var top10 Affiliated Same_ind_spec all_star leader  high_rev_freq long_gexp large_port optimistic bold_analyst ;
run;




*** Appendix Table A6 ***;


* Model 1 *;

proc surveylogistic data =PSDO_RFS.Table_A6;
class year_Dummy broker_Dummy;
cluster Fund_Dummy;
model executed(event="1") =  Ind_Exp_Analyst_Cov affiliated top10 Ind_expt_brk bratio year_Dummy broker_Dummy / rsq link = logit;
run;

* Model 2 *;

proc surveylogistic data =  PSDO_RFS.Table_A6;
class year_Dummy broker_Dummy;
cluster Fund_Dummy;
model executed(event="1") = Ind_Exp_Analyst_Cov  affiliated top10 Ind_expt_brk bratio all_star leader freq_rev long_gexp large_port optimistic bold_analyst year_Dummy broker_Dummy/rsq  link = logit;
run;

* Model 3 *;

proc surveylogistic data =  PSDO_RFS.Table_A6;
class year_Dummy broker_Dummy;
cluster Fund_Dummy;
model executed(event="1") = Ind_Exp_Analyst_Cov  affiliated top10 Ind_expt_brk bratio all_star leader freq_rev long_gexp large_port optimistic bold_analyst MBA high_accuracy ivy_league year_Dummy broker_Dummy/rsq  link = logit;
run;





*** Appendix Table A7 ***;


** Panel A **;


* Column 1 *;

Proc means data=PSDO_RFS.Table_A7_Panel_A mean  t prt;
var  Ind_Exp_A_High_Exp_Cov Ind_Exp_A_High_Exp_Cov_DGTW; 
run;

* Column 2 *;

Proc means data=PSDO_RFS.Table_A7_Panel_A mean  t prt;
var  Ind_Exp_A_Low_Exp_Holding_Cov Ind_Exp_A_Low_Exp_Cov_DGTW; 
run;

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_A7_Panel_A, First_var=Ind_Exp_A_High_Exp_Cov, Second_var=Ind_Exp_A_Low_Exp_Holding_Cov, Report_Column=2);
%Difference (Dataset=PSDO_RFS.Table_A7_Panel_A, First_var=Ind_Exp_A_High_Exp_Cov_DGTW, Second_var=Ind_Exp_A_Low_Exp_Cov_DGTW, Report_Column=2);


** Panel B **;


* Column 1 *;

Proc means data=PSDO_RFS.Table_A7_Panel_B mean  t prt;
var  Ind_Exp_A_High_Exp_LS Ind_Exp_A_High_Exp_LS_DGTW; 
run;

* Column 2 *;

Proc means data=PSDO_RFS.Table_A7_Panel_B mean  t prt;
var  Ind_Exp_A_Low_Exp_Holding_LS Ind_Exp_A_Low_Exp_LS_DGTW; 
run;

* Column 3 *;

%Difference (Dataset=PSDO_RFS.Table_A7_Panel_B, First_var=Ind_Exp_A_High_Exp_LS, Second_var=Ind_Exp_A_Low_Exp_Holding_LS, Report_Column=2);
%Difference (Dataset=PSDO_RFS.Table_A7_Panel_B, First_var=Ind_Exp_A_High_Exp_LS_DGTW, Second_var=Ind_Exp_A_Low_Exp_LS_DGTW, Report_Column=2);





*** Appendix Table A8 ***;


* Column 1 *;

Proc means data=PSDO_RFS.Table_A8_IS mean  t prt;
where column=1;
var  IS; 
run;

Proc means data=PSDO_RFS.Table_A8_IT mean  t prt;
where column=1;
var  IT; 
run;

* Column 2 *;

Proc means data=PSDO_RFS.Table_A8_IS mean  t prt;
where column=2;
var  IS; 
run;

Proc means data=PSDO_RFS.Table_A8_IT mean  t prt;
where column=2;
var  IT; 
run;

* Column 3 *;

Proc means data=PSDO_RFS.Table_A8_IS mean  t prt;
where column=3;
var  IS; 
run;

Proc means data=PSDO_RFS.Table_A8_IT mean  t prt;
where column=3;
var  IT; 
run;

* Column 4 *;

Proc means data=PSDO_RFS.Table_A8_IS mean  t prt;
where column=4;
var  IS; 
run;

Proc means data=PSDO_RFS.Table_A8_IT mean  t prt;
where column=4;
var  IT; 
run;

* Column 5 *;

Proc ttest data=PSDO_RFS.Table_A8_IS ;
where column=3 or column=4;
class column;
var  IS; 
run;

Proc ttest data=PSDO_RFS.Table_A8_IT ;
where column=3 or column=4;
class column;
var  IT; 
run;







